 
import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.ResultSet;
import java.sql.Statement;
 
 
public class connectiontest {
	public static void main(String[] args) {
 // hey
		Connection connection = null;
		ResultSet resultSet = null;
		Statement statement = null;
 
		try {
			Class.forName("org.sqlite.JDBC");
			connection = DriverManager
			.getConnection("jdbc:sqlite:/Users/abdalaziz202/MySQLiteDB");
			statement = connection.createStatement();
			//statement.executeUpdate("insert into PrivilegesInfo values('CSci5412', '55','VG','SC',5)");
			//statement.executeUpdate("insert into Grade values('CSci5412', '55','B+')");
			resultSet = statement
					.executeQuery("select Grade.CourseNum,Grade.StudentId,Grade.GradeType from Grade where CourseNum IN (select ObjectName from PrivilegesInfo where SubjectName ='55' and SetPriv='VG')");
			while (resultSet.next()) {
				System.out.println("Course:"
						+ resultSet.getString("CourseNum"));
			System.out.println("Student:"
					+ resultSet.getString("StudentId"));
			System.out.println("Grade:"
					+ resultSet.getString("GradeType"));
			}
		} catch (Exception e) {
			e.printStackTrace();
		} finally {
			try {
				resultSet.close();
				statement.close();
				connection.close();
			} catch (Exception e) {
				e.printStackTrace();
			}
		}
	}
}